<!doctype html>
<head>
    <meta charset="utf-8"/>
</head>
<body>
<div>可打开浏览器控制台查看结果</div>

CREATE TABLE `tb_sign` (
`id` varchar(40) NOT NULL,
`event_id` varchar(40) NOT NULL,
`open_id` varchar(100) DEFAULT NULL,
`invite_openid` varchar(100) DEFAULT NULL,
`invite_num` int(11) DEFAULT '0',
`invite_enter_times` int(11) DEFAULT '0',
`create_time` datetime DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`cellphone` varchar(11) DEFAULT NULL,
`company` varchar(255) DEFAULT NULL,
`department` varchar(255) DEFAULT NULL,
`position` varchar(255) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`telephone` varchar(255) DEFAULT NULL,
`sex` varchar(10) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`province` varchar(255) DEFAULT NULL,
`city` varchar(255) DEFAULT NULL,
`photo` varchar(255) DEFAULT NULL,
`ZIJf_` varchar(255) DEFAULT NULL,
`Rzqd_` varchar(250) DEFAULT NULL,
`lGTa_` varchar(250) DEFAULT NULL,
`HHrh_` text,
`islD_` varchar(100) DEFAULT NULL,
`wVyJ_` varchar(250) DEFAULT NULL,
`OIWo_` varchar(250) DEFAULT NULL,
`oemt_` varchar(250) DEFAULT NULL,
`SZKL_` varchar(100) DEFAULT NULL,
`sVvu_` varchar(100) DEFAULT NULL,
`BbaU_` varchar(250) DEFAULT NULL,
`sErT_` varchar(250) DEFAULT NULL,
`wakw_` varchar(250) DEFAULT NULL,
`WsNI_` varchar(250) DEFAULT NULL,
`jUxJ_` varchar(250) DEFAULT NULL,
`sign_level` int(1) DEFAULT NULL,
`QlAW_` varchar(250) DEFAULT NULL,
`mAzO_` varchar(1000) DEFAULT NULL,
`mTtX_` varchar(250) DEFAULT NULL,
`gift_number` varchar(40) DEFAULT NULL COMMENT '奖券号码',
`gift_number_url` varchar(255) DEFAULT NULL COMMENT '奖券号码二维码图片url',
`gift_content` varchar(32) DEFAULT NULL COMMENT '礼品内容',
`gift_create_time` datetime DEFAULT NULL COMMENT '奖券生成时间即获取时间',
`gift_receive_time` datetime DEFAULT NULL COMMENT '兑奖时间',
`gift_status` tinyint(1) DEFAULT '0' COMMENT '奖券状态(0未达成)、(1已达成未兑奖)、(2已达成已兑奖)',
`status` tinyint(4) DEFAULT '0' COMMENT '报名审核状态(0待审核, 1审核通过, 2审核不通过)',
`edit_time` datetime DEFAULT NULL,
`ugWA_` varchar(250) DEFAULT NULL,
`avMA_` varchar(250) DEFAULT NULL,
`lIRE_` varchar(250) DEFAULT NULL,
`qRDL_` varchar(250) DEFAULT NULL,
`rzTg_` varchar(100) DEFAULT NULL,
`yySy_` varchar(100) DEFAULT NULL,
`VzUB_` varchar(100) DEFAULT NULL,
`CKjy_` varchar(250) DEFAULT NULL,
`CzPP_` varchar(250) DEFAULT NULL,
`JSZh_` varchar(250) DEFAULT NULL,
`Auhk_` varchar(250) DEFAULT NULL,
`evkZ_` varchar(250) DEFAULT NULL,
`BISp_` varchar(250) DEFAULT NULL,
`eKes_` varchar(250) DEFAULT NULL,
`jetV_` varchar(250) DEFAULT NULL,
`Krrl_` varchar(250) DEFAULT NULL,
`sJUK_` varchar(250) DEFAULT NULL,
`Cefk_` varchar(250) DEFAULT NULL,
`YABw_` varchar(250) DEFAULT NULL,
`bQON_` varchar(250) DEFAULT NULL,
`Tcaj_` varchar(250) DEFAULT NULL,
`ABQH_` varchar(250) DEFAULT NULL,
`Dzdu_` varchar(250) DEFAULT NULL,
`BctS_` varchar(250) DEFAULT NULL,
`ibLK_` varchar(250) DEFAULT NULL,
`BJlT_` varchar(250) DEFAULT NULL,
`CyMI_` varchar(250) DEFAULT NULL,
`DWXR_` varchar(250) DEFAULT NULL,
`bLSp_` varchar(250) DEFAULT NULL,
`FVUr_` varchar(250) DEFAULT NULL,
`jjQL_` varchar(250) DEFAULT NULL,
`kMUM_` text,
`XSlR_` varchar(250) DEFAULT NULL,
`VoEy_` varchar(250) DEFAULT NULL,
`Bupm_` varchar(250) DEFAULT NULL,
`EWil_` varchar(250) DEFAULT NULL,
`MRcr_` varchar(250) DEFAULT NULL,
`Tjdz_` text,
`LwIq_` varchar(250) DEFAULT NULL,
`YWTS_` varchar(250) DEFAULT NULL,
`TcuB_` varchar(250) DEFAULT NULL,
`Sjfc_` varchar(250) DEFAULT NULL,
`vxTz_` varchar(250) DEFAULT NULL,
`rtgQ_` text,
`btdF_` text,
`znjl_` text,
`xQbj_` text,
`HyeD_` text,
`XHjz_` text,
`Ldnp_` text,
`hNUR_` text,
`LKnS_` varchar(120) DEFAULT NULL,
`id_card` varchar(250) DEFAULT NULL COMMENT '身份证',
PRIMARY KEY (`id`),
KEY `sign_rank` (`event_id`,`invite_enter_times`,`create_time`),
KEY `idx_user_evt` (`event_id`),
KEY `idx_user_evt_open` (`event_id`,`open_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/crypto-js/4.0.0/crypto-js.js"></script>
<script type="text/javascript">

    var appKey = '5fc233c6d4f7e8c3';
    var key = 'sm32N832nxzGHU5eHOun6m2P1fkuVfTP';//注意：暴露appSecret，有被盗用造成损失的风险
    var salt = (new Date).getTime();
    var curtime = Math.round(new Date().getTime()/1000);
    var query = '您好，欢迎再次使用有道智云文本翻译API接口服务';
    // 多个query可以用\n连接  如 query='apple\norange\nbanana\npear'
    var from = 'zh-CHS';
    var to = 'en';
    var str1 = appKey + truncate(query) + salt + curtime + key;
    var vocabId =  '您的用户词表ID';
    //console.log('---',str1);

    var sign = CryptoJS.SHA256(str1).toString(CryptoJS.enc.Hex);
    $.ajax({
        url: 'http://openapi.youdao.com/api',
        type: 'post',
        dataType: 'jsonp',
        data: {
            q: query,
            appKey: appKey,
            salt: salt,
            from: from,
            to: to,
            sign: sign,
            signType: "v3",
            curtime: curtime,
            vocabId: vocabId,
        },
        success: function (data) {
            console.log(data);
        }
    });

    function truncate(q){
        var len = q.length;
        if(len<=20) return q;
        return q.substring(0, 10) + len + q.substring(len-10, len);
    }
</script>
</body>